﻿using System;
using System.ComponentModel.DataAnnotations;
using LERP.Domain;

namespace LERP.Web.Controllers.ViewModels.GoodsViewModels
{
    public class CreateGoodsViveModel
    {
        /// <summary>
        /// 货品编号
        /// </summary>   
        [Display(Name = "货品编号")] 
        public virtual int Id { get; set; }
        /// <summary>
        /// 品名规格
        /// </summary>  
        [Display(Name = "品名规格")] 
        [StringLength(64, ErrorMessage = "{0}不能超过{1}个字符", MinimumLength = 0)]
        [Required(ErrorMessage = "{0}不能为空")]
        public virtual string Name { get; set; }

        /// <summary>
        /// 国际条码
        /// </summary>
        [Display(Name = "国际条码")]
        [StringLength(64, ErrorMessage = "{0}不能超过{1}个字符", MinimumLength = 0)] 
        public virtual string Gencod { get; set; }
        /// <summary>
        /// 包装单位
        /// </summary>  
        [Display(Name = "包装单位")]
        [Required(ErrorMessage = "{0}不能为空")]
        [StringLength(32, ErrorMessage = "{0}不能超过{1}个字符", MinimumLength = 0)]
        public virtual string Unit { get; set; }
        /// <summary>
        /// 销售单位
        /// </summary>  
        [Display(Name = "销售单位")]
        [Required(ErrorMessage = "{0}不能为空")]
        [StringLength(32, ErrorMessage = "{0}不能超过{1}个字符", MinimumLength = 0)]
        public virtual string SellUnit { get; set; }

        /// <summary>
        /// 销售价格
        /// </summary>   
        [Display(Name = "销售单价")]
        [Required(ErrorMessage = "{0}不能为空")]
        [RegularExpression("^[1-9]\\d*[\\.]?\\d*|0\\.\\d*[1-9]\\d*$", ErrorMessage = "只能输入大于0的数字")] 
        public virtual decimal Price { get; set; }

        /// <summary>
        /// 箱装数量
        /// </summary>  
        [Display(Name = "箱装数量")]
        [Required(ErrorMessage = "{0}不能为空")] 
        [RegularExpression("^[1-9]\\d*$", ErrorMessage = "只能输入正整数")] 
        public virtual int Num { get; set; }
        /// <summary>
        /// 箱体积
        /// </summary>   
        [Display(Name = "箱体积")]
        [Required(ErrorMessage = "{0}不能为空")]
        [RegularExpression("^[1-9]\\d*[\\.]?\\d*|0\\.\\d*[1-9]\\d*$", ErrorMessage = "只能输入大于0的数字")] 
        public virtual decimal Volume { get; set; }
        /// <summary>
        /// 箱重量
        /// </summary>   
        [Display(Name = "箱重量")]
        [Required(ErrorMessage = "{0}不能为空")]
        [RegularExpression("^[1-9]\\d*[\\.]?\\d*|0\\.\\d*[1-9]\\d*$", ErrorMessage = "只能输入大于0的数字")] 
        public virtual decimal PackageWeight { get; set; }
        /// <summary>
        /// 备注
        /// </summary>   
        [Display(Name = "备注")]
        [StringLength(500, ErrorMessage = "{0}不能超过{1}个字符", MinimumLength = 0)]
        public virtual string Remark { get; set; }
        /// <summary>
        /// 状态
        /// </summary>   
        [Display(Name = "状态")]
        [Required(ErrorMessage = "{0}不能为空")]
        public virtual int Status { get; set; }
        /// <summary>
        /// 添加日期
        /// </summary>   
        [Display(Name = "添加日期")]
        [Required(ErrorMessage = "{0}不能为空")]
        public virtual DateTime Created { get; set; }
        /// <summary>
        /// 修改日期
        /// </summary>   
        [Display(Name = "修改日期")]
        [Required(ErrorMessage = "{0}不能为空")]
        public virtual DateTime Modified { get; set; }

        /// <summary>
        /// 货品类别ID
        /// </summary>  
        [Display(Name = "货品类别")]
        [Required(ErrorMessage = "{0}不能为空")]
        public virtual int CategoryId { get; set; }

    }
}